#include <bits/stdc++.h>

using namespace std;
const int N=10005;
int a[N][N],b[N];
int main()
{
    freopen("detect.in","r",stdin);
    freopen("detect.out","w",stdout);
    int T,n,m,l,v;
    cin>>T;
    for(int i=1;i<=T;i++){
        cin>>n>>m>>l>>v;
        for(int j=1;j<=n;j++){
            cin>>a[j][1]>>a[j][2]>>a[j][3];
        }
        for(int x=1;x<=m;x++){
            cin>>b[x];
        }
    }

    cout<<3<<" "<<3;
    return 0;
}
